import json
import unittest
from tools import add
from parameterized import parameterized

from read_data import word_add


# class TestAssert(unittest_01.TestCase):
#     def test_equal_1(self):
#         self.assertEqual(10, 10)
#
#     def test_equal_2(self):
#         self.assertEqual(10, 11)
#
#
#     def test_in(self):
#         self.assertIn('admin','欢迎adminnnnnnnnn登录')
# class TestAdd(unittest_01.TestCase):
#     def test_add(self):
#         self.assertEqual(2, add(1, 1))
#         self.assertEqual(3, add(1, 2))
#         self.assertEqual(7, add(3, 4))
#         self.assertEqual(9, add(4, 5))

# data = [(1,1,2),(1,2,3),(2,3,5),(4,5,9)]
class TestAdd(unittest.TestCase):

    @parameterized.expand(word_add())
    def test_add(self, a, b, expact):
        self.assertEqual(expact, add(a, b))
